home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / mips-sgi-irix6.2 / tmdecode.z / tmdecode
Encoding:
Text File  |  1998-05-21  |  1.4 KB  |  60 lines

  1. #!/bin/sh -
  2. #
  3. # $Id: tmdecode,v 4.1 1997/01/10 14:47:06 morioka Exp $
  4. #
  5. # Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
  6.  
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2, or (at your option)
  10. # any later version.
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15. # You should have received a copy of the GNU General Public License
  16. # along with GNU Emacs; see the file COPYING.  If not, write to the
  17. # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. # Boston, MA 02111-1307, USA.
  19.  
  20. PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
  21.  
  22. trap 'rm -f $2' 0 1 2 3 13 15
  23.  
  24. case "$3" in
  25. /dev/stdout)
  26.     OUTPUT=
  27.     ;;
  28. *)
  29.     OUTPUT='> $3'
  30.     ;;
  31. esac
  32.  
  33. case "$1" in
  34. ""|"7bit"|"8bit"|"binary")
  35.     eval "cat $2 $OUTPUT"
  36.     ;;
  37. "base64")
  38.     #eval "decode-b < $2 $OUTPUT"
  39.     eval "mmencode -u $2 $OUTPUT"
  40.     ;;
  41. "quoted-printable")
  42.     eval "mmencode -q -u $2 $OUTPUT"
  43.     ;;
  44. "x-uue"|"x-uuencode")
  45.     (cd $TM_TMP_DIR ; uudecode $2)
  46.     ;;
  47. "x-gzip64")
  48.     #eval "decode-b < $2 | gzip -cd $OUTPUT"
  49.     eval "mmencode -u $2 | gzip -cd $OUTPUT"
  50.     ;;
  51. *)
  52.     echo "unknown encoding"
  53.     exit -1
  54.     ;;
  55. esac
  56.  
  57. # echo "$2 was removed."
  58.